home *** CD-ROM | disk | FTP | other *** search
- Path: newserv.agcs.com!news
- From: "George B. T. Greene" <greeneg@agcs.com>
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: Statistically Random Number algorithm
- Date: 19 Mar 1996 19:35:52 GMT
- Organization: AG Communication Systems, ITS
- Message-ID: <4in2ao$5ee@newserv.agcs.com>
- References: <314D0B67.3C16@psu.edu>
- NNTP-Posting-Host: greeneg.agcs.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 32bit)
-
- Whew!
-
- "Jason A. Soloff" <jas251@psu.edu> wrote:
- >
- >I am working on a monte carlo simulation program to model some problems
- >in astronomy. One thing I am running into, however, is the problem of
- >the pseudo-random number tables. Does anyone have an algorithm (or
- >code) for a truly statistically random number generator?
-
- This is not exactly a trivial question. I'd suggest for a start getting a
- copy of Donald Knuth's "The Art of Computer Programming" volume 2:
- "Seminumerical Algorithms," and reading chapter 3. You'll learn a lot
- about what it takes to make a (pseudo)-random number sequence "good" in
- some sense, and how to test the result of any effort in that direction.
- Check out his "algorithm M" in particular. However, please note that the
- chapter starts with a quote from John von Neumann: "Anyone who considers
- arithmetical methods of producing random number digits is, of course, in a
- state of sin."
-
- You should also give some thought as to how you are going to use the
- numbers. For example, if you use them in pairs, or n-tuples generally,
- you'd want to check the distribution of the tuples. (I can imagine your
- project as generating simulated star fields, in which case you might be
- generating position coordinate pairs for individual stars.)
-
-
-